package com.sa.impl;

import cn.dev33.satoken.stp.StpInterface;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * 校验权限和角色，即鉴权
 *
 * @author wangxiaohui
 * @date 2023/6/9 17:01
 */

@Component
public class StpInterfaceImpl implements StpInterface {

    @Override
    public List<String> getPermissionList(Object o, String s) {

        List<String> permissions = new ArrayList<>();
        permissions.add("1000");
        permissions.add("user:add");
        permissions.add("user:update");
        permissions.add("app:*");

        return permissions;
    }

    @Override
    public List<String> getRoleList(Object o, String s) {

        List<String> roles = new ArrayList<>();
        roles.add("admin");
        roles.add("bizAdmin");

        return roles;
    }

}
